{% extends "base.html" %}
{% block javascript %}
<script>
    $(function () {
        $('#myModal').modal('hide')
    });
</script>
{% endblock %}
{% block main %}
        <div id="page-wrapper">

            <div class="container-fluid">

                <!-- Page Heading -->
                <div class="row">
                    <div class="col-lg-12">
                        <h3 class="page-header">
                            Server Automation
                        </h3>
                        <ol class="breadcrumb">
                            <li>
                                <i class="fa fa-dashboard"></i>  <a href="../index">Dashboard</a>
                            </li>
                            <li class="active">
                                <i class="fa fa-table"></i> Server Automation
                            </li>
                        </ol>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-12">
                        <h4 class="well">
                            Contextual Classes
                        {% if run_time != 0 %}
                        <font style="color: #3d8b3d;font-size: 13px;margin-top: 2px;float: right;margin-right: 15%">
                        Run Time: {{ run_time }}
                        </font>
                        {% endif %}
                        <form method="get">
                            <input name="run_states" class="btn btn-default" style="float: right;margin-top: -28px;" type="submit" value="{{ state }}"/>
                        </form>
                        </h4>
                        <div class="table-responsive">
                            <table class="table table-bordered table-hover table-striped" style="height:10px;">
                                <thead>
                                    <tr class="info">
{#                                        <th class="col-lg-1" style="text-align: center">#</th>#}
                                        <th class = 'col-lg-2' style="text-align: center">端口</th>
                                        <th class = 'col-lg-3' style="text-align: center;">接口</th>
                                        <th class = 'col-lg-1' style="text-align: center">结果</th>
                                        <th class = 'col-lg-2' style="text-align: center">模块</th>
                                        <th class = 'col-lg-2' style="text-align: center">用例</th>
{#                                        <th class = 'col-lg-1' style="text-align: center">提醒</th>#}
                                        <th class = 'col-lg-1' style="text-align: center">时间戳</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {% for show in atserverlist.object_list %}
                                        <tr {% if show.result == 0 %}class="danger"{% endif %}{% if show.result == 1 %}class="success"{% else %}class="active"{% endif %}>
                                            <div>
{#                                                <td style="text-align: center">{{ show.id }}</td>#}
                                                <td style="text-align: center">{{ show.host }}</td>
                                                <td>
                                                    <div style="position:relative;width: 200px;height:auto;; overflow-x:auto">
                                                    {{ show.interface }}
                                                    </div>
                                                </td>
                                                <td style="text-align: center">{{ show.result_describe }}</td>
                                                <td style="text-align: center">{{ show.module }}</td>
                                                <td style="text-align: center;">
                                                    <div style="position:relative;width: 200px;height: auto; overflow-x:auto">
                                                   {{ show.casename }}
                                                    </div>
                                                </td>
{#                                                <td style="text-align: center">{{ show.notice_describe }}</td>#}
                                                <td style="text-align: center">{{ show.time }}</td>
                                            </div>
                                        </tr>
                                    {% empty %}
                                        <tr>
                                            暂无数据
                                        </tr>
                                    {% endfor %}
                                </tbody>
                            </table>
                            <div class="row col-lg-12" style="text-align: center">
                                <span class="step-links">
                                    <ul class="pager">
                                     {% if atserverlist.has_previous %}
                                     <li class="prev">
                                         <a href="?page={{ atserverlist.previous_page_number }}" class="previous">上一页</a>
                                     </li>
                                     {% endif %}
                                     第 {{ atserverlist.number }}/{{ atserverlist.paginator.num_pages }} 页
                                     {% if atserverlist.has_next %}
                                         <li class="prev">
                                             <a href="?page={{ atserverlist.next_page_number }}">下一页</a>
                                         </li>
                                     {% endif %}
                                        <li class="next"><a>共{{ atserver.count }}条</a></li>
                                    </ul>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.row -->

            </div>
            <!-- /.container-fluid -->

        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="../static/js/jquery.js"></script>
{#    <script src="../static/js/sweet-alert.min.js"></script>#}
{#    <link rel="stylesheet" type="text/css" href="../static/css/sweet-alert.css">#}

    <!-- Bootstrap Core JavaScript -->
    <script src="../static/js/bootstrap.min.js"></script>
{% endblock %}

</body>

</html>
